package org.yray.sip.visit;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.yray.sip.factory.IdRuleComponent;

@Component
public class SipVisitorFactory {

    @Autowired
    private IdRuleComponent idRuleComponent;
    private ISipAccept aLegSipAccept=new ALegSipAccept();
    private ISipAccept bLegSipAccept=new BLegSipAccept();

    //408,480
    public static final ISipVisitor SIP_ERR_VISITOR=new SipErrVisitor();
    public static final ISipVisitor SIP_183_VISITOR=new Sip183Visitor();
    public static final ISipVisitor SIP_200_VISITOR=new Sip200Visitor();
    public static final ISipVisitor SIP_BYE_VISITOR=new SipByeVisitor();
    public ISipAccept getSipAccept(String id)
    {
        return idRuleComponent.isALeg(id)?aLegSipAccept:bLegSipAccept;
    }
}
